<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="test">
        <div>1年龄：{{age}}  </div>

        <!-- 遍历对象 -->
        <div v-for="(value,key,index) in user">
            {{index}}_{{key}}: {{value}};
        </div>

        <!-- 遍历数组 -->
        <div v-for="(name,index) in names">
            {{index}}_{{name}}
        </div>

        <!-- 变量含有对象的数组 -->
        <div v-for="(user,index) in users">
            方1：{{index}}___{{user}}
            方2：{{index}}___name:{{user.name}};age"{{user.age}};bir:{{user.bir}}
        </div>

    </div>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    let vue = new Vue({
        el:"#test",
        data:{
            age:18,
            user:{
                name:"小龙",
                age:18,
                bir:"2003"
            },
            names:["龙","陈","CL"],
            users:[
                {name:"小龙",age:18,bir:2003},
                {name:"小c",age:20,bir:2004},
                {name:"小l",age:22,bir:2002},
            ]

        },
        methods:{
           test1() {
                this.cla = !this.cla
           }
        }
    });
    console.log(vue)
</script>